package cn.xiaosiyuan.temp;

import cn.hutool.core.swing.clipboard.ClipboardUtil;
import cn.xiaosiyuan.util.X;
import cn.xiaosiyuan.util.interfaces.IFileUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Demo {

    public static void main(String[] args) {

        String xmlPath = X.pathUtil.getByRelativePath("/xml2sql/work/tb_work_project_demand.xml");
        String sqlPath = "d:/work/sql/20211119workHandler.sql";

        HashMap<String, List<Map<String, String>>> map = X.xmlUtil.parseSqlXML(xmlPath);
        String createTableSql = X.sqlUtil.getCreateTableSql(map);

        IFileUtil file = X.fileUtil.createFile(sqlPath);
        file.append(createTableSql);

        ClipboardUtil.setStr("source " + sqlPath);

    }

}
